class SaleOrder(models.Model):
_name = 'sale.order'
partner_id = fields.Many2one('res.partner', string='Customer')
# 其他字段...
class SaleOrder(models.Model):
_name = 'sale.order'
order_line_ids = fields.One2many('sale.order.line', 'order_id', string='Order Lines')
# 其他字段...
class SaleOrderLine(models.Model):
_name = 'sale.order.line'
order_id = fields.Many2one('sale.order', string='Order')
# 其他字段...
class ProductProduct(models.Model):
_name = 'product.product'
category_ids = fields.Many2many('product.category', 'product_category_rel', 'product_id', 'category_id', string='Categories')
# 其他字段...
class ProductCategory(models.Model):
_name = 'product.category'
product_ids = fields.Many2many('product.product', 'product_category_rel', 'category_id', 'product_id', string='Products')
# 其他字段...